package org.creativor.rayson.client;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import java.io.DataInput;
import java.io.DataInputStream;
import java.io.PipedInputStream;
import java.net.InetSocketAddress;
import org.creativor.rayson.api.CallFuture;
import org.creativor.rayson.common.Invocation;
import org.creativor.rayson.transport.common.Packet;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

/**
 * The class <code>ClientCallTest</code> contains tests for the class
 * <code>{@link ClientCall}</code>.
 * <p>
 * Copyright Creativor Studio (c) 2011
 * 
 * @generatedBy CodePro at 11-5-7 上午3:08
 * @author Nick Zhang
 * @version $Revision: 1.0 $
 */
public class ClientCallTest
{
	/**
	 * Launch the test.
	 * 
	 * @param args
	 *            the command line arguments
	 * 
	 * @generatedBy CodePro at 11-5-7 上午3:08
	 */
	public static void main(String[] args)
	{
		new org.junit.runner.JUnitCore().run(ClientCallTest.class);
	}
	
	/**
	 * Perform pre-test initialization.
	 * 
	 * @throws Exception
	 *             if the initialization fails for some reason
	 * 
	 * @generatedBy CodePro at 11-5-7 上午3:08
	 */
	@Before
	public void setUp() throws Exception
	{
		// TODO: add additional set up code here
	}
	
	/**
	 * Perform post-test clean-up.
	 * 
	 * @throws Exception
	 *             if the clean-up fails for some reason
	 * 
	 * @generatedBy CodePro at 11-5-7 上午3:08
	 */
	@After
	public void tearDown() throws Exception
	{
		// TODO: add additional tear down code here
	}
	
	/**
	 * Run the ClientCall(ProxySession,Invocation,CallFutureImpl<V>) constructor
	 * test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午3:08
	 */
	@Test
	public void testClientCall_1() throws Exception
	{
		ProxySession session =
				new ProxySession((byte) 1, (short) 1, "", (new InetSocketAddress(1)).getAddress());
		Invocation invocation = new Invocation();
		CallFutureImpl<Object> future = new CallFutureImpl(new Class[] {});
		
		ClientCall result = new ClientCall(session, invocation, future);
		
		// TODO: add additional test code here
		// An unexpected exception was thrown in user code while executing this
		// test:
		// java.lang.NullPointerException
		// at org.creativor.rayson.common.Invocation.write(Invocation.java:161)
		// at org.creativor.rayson.client.ClientCall.<init>(ClientCall.java:53)
		assertNotNull(result);
	}
	
	/**
	 * Run the ClientCall(ProxySession,Invocation,CallFutureImpl<V>) constructor
	 * test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午3:08
	 */
	@Test
	public void testClientCall_2() throws Exception
	{
		ProxySession session =
				new ProxySession((byte) 1, (short) 1, "", (new InetSocketAddress(1)).getAddress());
		Invocation invocation = new Invocation();
		CallFutureImpl<Object> future = new CallFutureImpl(new Class[] {});
		
		ClientCall result = new ClientCall(session, invocation, future);
		
		// TODO: add additional test code here
		// An unexpected exception was thrown in user code while executing this
		// test:
		// java.lang.NullPointerException
		// at org.creativor.rayson.common.Invocation.write(Invocation.java:161)
		// at org.creativor.rayson.client.ClientCall.<init>(ClientCall.java:53)
		assertNotNull(result);
	}
	
	/**
	 * Run the ClientCall(ProxySession,Invocation,CallFutureImpl<V>) constructor
	 * test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午3:08
	 */
	@Test
	public void testClientCall_3() throws Exception
	{
		ProxySession session =
				new ProxySession((byte) 1, (short) 1, "", (new InetSocketAddress(1)).getAddress());
		Invocation invocation = new Invocation();
		CallFutureImpl<Object> future = new CallFutureImpl(new Class[] {});
		
		ClientCall result = new ClientCall(session, invocation, future);
		
		// TODO: add additional test code here
		// An unexpected exception was thrown in user code while executing this
		// test:
		// java.lang.NullPointerException
		// at org.creativor.rayson.common.Invocation.write(Invocation.java:161)
		// at org.creativor.rayson.client.ClientCall.<init>(ClientCall.java:53)
		assertNotNull(result);
	}
	
	/**
	 * Run the ClientCall(ProxySession,Invocation,CallFutureImpl<V>) constructor
	 * test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午3:08
	 */
	@Test
	public void testClientCall_4() throws Exception
	{
		ProxySession session =
				new ProxySession((byte) 1, (short) 1, "", (new InetSocketAddress(1)).getAddress());
		Invocation invocation = new Invocation();
		CallFutureImpl<Object> future = new CallFutureImpl(new Class[] {});
		
		ClientCall result = new ClientCall(session, invocation, future);
		
		// TODO: add additional test code here
		// An unexpected exception was thrown in user code while executing this
		// test:
		// java.lang.NullPointerException
		// at org.creativor.rayson.common.Invocation.write(Invocation.java:161)
		// at org.creativor.rayson.client.ClientCall.<init>(ClientCall.java:53)
		assertNotNull(result);
	}
	
	/**
	 * Run the ClientCall(ProxySession,Invocation,CallFutureImpl<V>) constructor
	 * test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午3:08
	 */
	@Test
	public void testClientCall_5() throws Exception
	{
		ProxySession session =
				new ProxySession((byte) 1, (short) 1, "", (new InetSocketAddress(1)).getAddress());
		Invocation invocation = new Invocation();
		CallFutureImpl<Object> future = new CallFutureImpl(new Class[] {});
		
		ClientCall result = new ClientCall(session, invocation, future);
		
		// TODO: add additional test code here
		// An unexpected exception was thrown in user code while executing this
		// test:
		// java.lang.NullPointerException
		// at org.creativor.rayson.common.Invocation.write(Invocation.java:161)
		// at org.creativor.rayson.client.ClientCall.<init>(ClientCall.java:53)
		assertNotNull(result);
	}
	
	/**
	 * Run the ClientCall(ProxySession,Invocation,CallFutureImpl<V>) constructor
	 * test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午3:08
	 */
	@Test
	public void testClientCall_6() throws Exception
	{
		ProxySession session =
				new ProxySession((byte) 1, (short) 1, "", (new InetSocketAddress(1)).getAddress());
		Invocation invocation = new Invocation();
		CallFutureImpl<Object> future = new CallFutureImpl(new Class[] {});
		
		ClientCall result = new ClientCall(session, invocation, future);
		
		// TODO: add additional test code here
		// An unexpected exception was thrown in user code while executing this
		// test:
		// java.lang.NullPointerException
		// at org.creativor.rayson.common.Invocation.write(Invocation.java:161)
		// at org.creativor.rayson.client.ClientCall.<init>(ClientCall.java:53)
		assertNotNull(result);
	}
	
	/**
	 * Run the CallFuture<Object> getFuture() method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午3:08
	 */
	@Test
	public void testGetFuture_1() throws Exception
	{
		ClientCall fixture =
				new ClientCall(new ProxySession((byte) 1, (short) 1, "",
						(new InetSocketAddress(1)).getAddress()), new Invocation(),
						new CallFutureImpl(new Class[] {}));
		
		CallFuture<Object> result = fixture.getFuture();
		
		// TODO: add additional test code here
		// An unexpected exception was thrown in user code while executing this
		// test:
		// java.lang.NullPointerException
		// at org.creativor.rayson.common.Invocation.write(Invocation.java:161)
		// at org.creativor.rayson.client.ClientCall.<init>(ClientCall.java:53)
		assertNotNull(result);
	}
	
	/**
	 * Run the long getId() method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午3:08
	 */
	@Test
	public void testGetId_1() throws Exception
	{
		ClientCall fixture =
				new ClientCall(new ProxySession((byte) 1, (short) 1, "",
						(new InetSocketAddress(1)).getAddress()), new Invocation(),
						new CallFutureImpl(new Class[] {}));
		
		long result = fixture.getId();
		
		// TODO: add additional test code here
		// An unexpected exception was thrown in user code while executing this
		// test:
		// java.lang.NullPointerException
		// at org.creativor.rayson.common.Invocation.write(Invocation.java:161)
		// at org.creativor.rayson.client.ClientCall.<init>(ClientCall.java:53)
		assertEquals(0L, result);
	}
	
	/**
	 * Run the Invocation getInvocation() method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午3:08
	 */
	@Test
	public void testGetInvocation_1() throws Exception
	{
		ClientCall fixture =
				new ClientCall(new ProxySession((byte) 1, (short) 1, "",
						(new InetSocketAddress(1)).getAddress()), new Invocation(),
						new CallFutureImpl(new Class[] {}));
		
		Invocation result = fixture.getInvocation();
		
		// TODO: add additional test code here
		// An unexpected exception was thrown in user code while executing this
		// test:
		// java.lang.NullPointerException
		// at org.creativor.rayson.common.Invocation.write(Invocation.java:161)
		// at org.creativor.rayson.client.ClientCall.<init>(ClientCall.java:53)
		assertNotNull(result);
	}
	
	/**
	 * Run the Packet getRequestPacket() method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午3:08
	 */
	@Test
	public void testGetRequestPacket_1() throws Exception
	{
		ClientCall fixture =
				new ClientCall(new ProxySession((byte) 1, (short) 1, "",
						(new InetSocketAddress(1)).getAddress()), new Invocation(),
						new CallFutureImpl(new Class[] {}));
		
		Packet result = fixture.getRequestPacket();
		
		// TODO: add additional test code here
		// An unexpected exception was thrown in user code while executing this
		// test:
		// java.lang.NullPointerException
		// at org.creativor.rayson.common.Invocation.write(Invocation.java:161)
		// at org.creativor.rayson.client.ClientCall.<init>(ClientCall.java:53)
		assertNotNull(result);
	}
	
	/**
	 * Run the Object getResult() method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午3:08
	 */
	@Test
	public void testGetResult_1() throws Exception
	{
		ClientCall fixture =
				new ClientCall(new ProxySession((byte) 1, (short) 1, "",
						(new InetSocketAddress(1)).getAddress()), new Invocation(),
						new CallFutureImpl(new Class[] {}));
		
		Object result = fixture.getResult();
		
		// TODO: add additional test code here
		// An unexpected exception was thrown in user code while executing this
		// test:
		// java.lang.NullPointerException
		// at org.creativor.rayson.common.Invocation.write(Invocation.java:161)
		// at org.creativor.rayson.client.ClientCall.<init>(ClientCall.java:53)
		assertNotNull(result);
	}
	
	/**
	 * Run the Object getResult() method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午3:08
	 */
	@Test
	public void testGetResult_2() throws Exception
	{
		ClientCall fixture =
				new ClientCall(new ProxySession((byte) 1, (short) 1, "",
						(new InetSocketAddress(1)).getAddress()), new Invocation(),
						new CallFutureImpl(new Class[] {}));
		
		Object result = fixture.getResult();
		
		// TODO: add additional test code here
		// An unexpected exception was thrown in user code while executing this
		// test:
		// java.lang.NullPointerException
		// at org.creativor.rayson.common.Invocation.write(Invocation.java:161)
		// at org.creativor.rayson.client.ClientCall.<init>(ClientCall.java:53)
		assertNotNull(result);
	}
	
	/**
	 * Run the Object getResult() method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午3:08
	 */
	@Test
	public void testGetResult_3() throws Exception
	{
		ClientCall fixture =
				new ClientCall(new ProxySession((byte) 1, (short) 1, "",
						(new InetSocketAddress(1)).getAddress()), new Invocation(),
						new CallFutureImpl(new Class[] {}));
		
		Object result = fixture.getResult();
		
		// TODO: add additional test code here
		// An unexpected exception was thrown in user code while executing this
		// test:
		// java.lang.NullPointerException
		// at org.creativor.rayson.common.Invocation.write(Invocation.java:161)
		// at org.creativor.rayson.client.ClientCall.<init>(ClientCall.java:53)
		assertNotNull(result);
	}
	
	/**
	 * Run the Object getResult() method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午3:08
	 */
	@Test
	public void testGetResult_4() throws Exception
	{
		ClientCall fixture =
				new ClientCall(new ProxySession((byte) 1, (short) 1, "",
						(new InetSocketAddress(1)).getAddress()), new Invocation(),
						new CallFutureImpl(new Class[] {}));
		
		Object result = fixture.getResult();
		
		// TODO: add additional test code here
		// An unexpected exception was thrown in user code while executing this
		// test:
		// java.lang.NullPointerException
		// at org.creativor.rayson.common.Invocation.write(Invocation.java:161)
		// at org.creativor.rayson.client.ClientCall.<init>(ClientCall.java:53)
		assertNotNull(result);
	}
	
	/**
	 * Run the void notifyConnectionClosed() method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午3:08
	 */
	@Test
	public void testNotifyConnectionClosed_1() throws Exception
	{
		ClientCall fixture =
				new ClientCall(new ProxySession((byte) 1, (short) 1, "",
						(new InetSocketAddress(1)).getAddress()), new Invocation(),
						new CallFutureImpl(new Class[] {}));
		
		fixture.notifyConnectionClosed();
		
		// TODO: add additional test code here
		// An unexpected exception was thrown in user code while executing this
		// test:
		// java.lang.NullPointerException
		// at org.creativor.rayson.common.Invocation.write(Invocation.java:161)
		// at org.creativor.rayson.client.ClientCall.<init>(ClientCall.java:53)
	}
	
	/**
	 * Run the void readResult(DataInput) method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午3:08
	 */
	@Test
	public void testReadResult_1() throws Exception
	{
		ClientCall fixture =
				new ClientCall(new ProxySession((byte) 1, (short) 1, "",
						(new InetSocketAddress(1)).getAddress()), new Invocation(),
						new CallFutureImpl(new Class[] {}));
		DataInput in = new DataInputStream(new PipedInputStream());
		
		fixture.readResult(in);
		
		// TODO: add additional test code here
		// An unexpected exception was thrown in user code while executing this
		// test:
		// java.lang.NullPointerException
		// at org.creativor.rayson.common.Invocation.write(Invocation.java:161)
		// at org.creativor.rayson.client.ClientCall.<init>(ClientCall.java:53)
	}
	
	/**
	 * Run the void readResult(DataInput) method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午3:08
	 */
	@Test
	public void testReadResult_2() throws Exception
	{
		ClientCall fixture =
				new ClientCall(new ProxySession((byte) 1, (short) 1, "",
						(new InetSocketAddress(1)).getAddress()), new Invocation(),
						new CallFutureImpl(new Class[] {}));
		DataInput in = new DataInputStream(new PipedInputStream());
		
		fixture.readResult(in);
		
		// TODO: add additional test code here
		// An unexpected exception was thrown in user code while executing this
		// test:
		// java.lang.NullPointerException
		// at org.creativor.rayson.common.Invocation.write(Invocation.java:161)
		// at org.creativor.rayson.client.ClientCall.<init>(ClientCall.java:53)
	}
	
	/**
	 * Run the void readResult(DataInput) method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午3:08
	 */
	@Test
	public void testReadResult_3() throws Exception
	{
		ClientCall fixture =
				new ClientCall(new ProxySession((byte) 1, (short) 1, "",
						(new InetSocketAddress(1)).getAddress()), new Invocation(),
						new CallFutureImpl(new Class[] {}));
		DataInput in = new DataInputStream(new PipedInputStream());
		
		fixture.readResult(in);
		
		// TODO: add additional test code here
		// An unexpected exception was thrown in user code while executing this
		// test:
		// java.lang.NullPointerException
		// at org.creativor.rayson.common.Invocation.write(Invocation.java:161)
		// at org.creativor.rayson.client.ClientCall.<init>(ClientCall.java:53)
	}
	
	/**
	 * Run the void readResult(DataInput) method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午3:08
	 */
	@Test
	public void testReadResult_4() throws Exception
	{
		ClientCall fixture =
				new ClientCall(new ProxySession((byte) 1, (short) 1, "",
						(new InetSocketAddress(1)).getAddress()), new Invocation(),
						new CallFutureImpl(new Class[] {}));
		DataInput in = new DataInputStream(new PipedInputStream());
		
		fixture.readResult(in);
		
		// TODO: add additional test code here
		// An unexpected exception was thrown in user code while executing this
		// test:
		// java.lang.NullPointerException
		// at org.creativor.rayson.common.Invocation.write(Invocation.java:161)
		// at org.creativor.rayson.client.ClientCall.<init>(ClientCall.java:53)
	}
	
	/**
	 * Run the void readResult(DataInput) method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午3:08
	 */
	@Test
	public void testReadResult_5() throws Exception
	{
		ClientCall fixture =
				new ClientCall(new ProxySession((byte) 1, (short) 1, "",
						(new InetSocketAddress(1)).getAddress()), new Invocation(),
						new CallFutureImpl(new Class[] {}));
		DataInput in = new DataInputStream(new PipedInputStream());
		
		fixture.readResult(in);
		
		// TODO: add additional test code here
		// An unexpected exception was thrown in user code while executing this
		// test:
		// java.lang.NullPointerException
		// at org.creativor.rayson.common.Invocation.write(Invocation.java:161)
		// at org.creativor.rayson.client.ClientCall.<init>(ClientCall.java:53)
	}
	
	/**
	 * Run the void readResult(DataInput) method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午3:08
	 */
	@Test
	public void testReadResult_6() throws Exception
	{
		ClientCall fixture =
				new ClientCall(new ProxySession((byte) 1, (short) 1, "",
						(new InetSocketAddress(1)).getAddress()), new Invocation(),
						new CallFutureImpl(new Class[] {}));
		DataInput in = new DataInputStream(new PipedInputStream());
		
		fixture.readResult(in);
		
		// TODO: add additional test code here
		// An unexpected exception was thrown in user code while executing this
		// test:
		// java.lang.NullPointerException
		// at org.creativor.rayson.common.Invocation.write(Invocation.java:161)
		// at org.creativor.rayson.client.ClientCall.<init>(ClientCall.java:53)
	}
	
	/**
	 * Run the void readResult(DataInput) method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午3:08
	 */
	@Test
	public void testReadResult_7() throws Exception
	{
		ClientCall fixture =
				new ClientCall(new ProxySession((byte) 1, (short) 1, "",
						(new InetSocketAddress(1)).getAddress()), new Invocation(),
						new CallFutureImpl(new Class[] {}));
		DataInput in = new DataInputStream(new PipedInputStream());
		
		fixture.readResult(in);
		
		// TODO: add additional test code here
		// An unexpected exception was thrown in user code while executing this
		// test:
		// java.lang.NullPointerException
		// at org.creativor.rayson.common.Invocation.write(Invocation.java:161)
		// at org.creativor.rayson.client.ClientCall.<init>(ClientCall.java:53)
	}
	
	/**
	 * Run the String toString() method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午3:08
	 */
	@Test
	public void testToString_1() throws Exception
	{
		ClientCall fixture =
				new ClientCall(new ProxySession((byte) 1, (short) 1, "",
						(new InetSocketAddress(1)).getAddress()), new Invocation(),
						new CallFutureImpl(new Class[] {}));
		
		String result = fixture.toString();
		
		// TODO: add additional test code here
		// An unexpected exception was thrown in user code while executing this
		// test:
		// java.lang.NullPointerException
		// at org.creativor.rayson.common.Invocation.write(Invocation.java:161)
		// at org.creativor.rayson.client.ClientCall.<init>(ClientCall.java:53)
		assertNotNull(result);
	}
}
